#!/bin/bash

dt='{{ execution_date | cst_hour }}'

defaultFS="hdfs://10.33.50.201:8020"
hadoop distcp  -m 10 /dw/hive/bidefault.db/external/dm_oms_order_mark_detail_hi/dt=${dt}  ${defaultFS}/dw/hive/jms_dm.db/external/dm_oms_order_mark_detail_hi
if [ $? = 0 ];then
  echo "hadoop distcp -m 10 /dw/hive/bidefault.db/external/dm_oms_order_mark_detail_hi/dt=${dt} ${defaultFS}/dw/hive/jms_dm.db/external/dm_oms_order_mark_detail_hi successfuly!"
else
  defaultFS2="hdfs://10.33.50.202:8020"
  hadoop distcp -m 10 /dw/hive/bidefault.db/external/dm_oms_order_mark_detail_hi/dt=${dt} ${defaultFS2}/dw/hive/jms_dm.db/external/dm_oms_order_mark_detail_hi
  if [ $? = 0 ];then
    echo "hadoop distcp -m 10 /dw/hive/bidefault.db/external/dm_oms_order_mark_detail_hi/dt=${dt} ${defaultFS2}/dw/hive/jms_dm.db/external/dm_oms_order_mark_detail_hi successfully!"
  else
    echo "hadoop distcp /dw/hive/bidefault.db/external/dm_oms_order_mark_detail_hi/dt=${dt} failed!"
    exit 1
  fi
fi